home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / TURB_VIS / ALEXLEVI / DOC / README.DOC < prev    next >
Text File  |  1994-04-03  |  6KB  |  151 lines

  1.  
  2. Operating instructions
  3.  
  4. 1. Programmer's notes
  5.  
  6. A. All the modules except MyGadget has a simple general interface: each module
  7. includes three procedures - OpenXXX, WhereXXX and RegisterXXX, where XXX is:
  8.  
  9. - ProgrammerCalculator for a Programmer Calculator
  10. - PrintManager           for a Print Manager
  11. - Notebook           for a Notebook
  12. - MouseEditor           for a Mouse Graphic Cursor Editor
  13. - VGAFontEditor        for a VGA Font Editor
  14. - EpsonFontEditor      for a Epson Font Editor
  15. - KeyboardMapEditor    for a Keyboard Map Editor
  16.  
  17. The procedure OpenXXX opens a suitable window on the DeskTop (if there isn't
  18. yet such a window, the procdure creates it. Otherwise it pops and activates
  19. it). OpenNotebook procedure has single parameter - notebook file name (PathStr,
  20. but may be used any string type). Other OpenXXX procedures hasn't parameters.
  21.  
  22. The function WhereXXX returns a pointer to a suitable window if it exists,
  23. otherwise - NIL.
  24.  
  25. The procedure RegisterXXX register the window to use in a stream (if your
  26. program does not use resources and operations like Save DeskTop, then there is
  27. usually no need to use this procedure).
  28.  
  29. Note: all these objects use colors from CCyanDialog in a non-standard way.
  30. If you wish to use TColorDialog, then you should rewrite the GetPalette method
  31. of these objects. 
  32.  
  33. Let's look at an example - a VGA Font Editor program:
  34.  
  35. Program VGA_Font_Editor;
  36.  
  37. Uses Views,    { Required Constants }
  38.      MsgBox,    { MessageBox procedure }
  39.      App,    { Main program }
  40.      EdVGAfnt;    { VGA Font Editor }
  41.  
  42. var
  43.  
  44.  A: TApplication; { Main program variable }
  45.  
  46. begin
  47.  { Initialize main program }
  48.  A.Init;
  49.  { Create a VGA Font Editor and insert it into the desktop }
  50.  OpenVGAFontEditor;
  51.  { if Font Editor was created ... }
  52.  if WhereVGAFontEditor <> NIL then
  53.   begin
  54.   { Disable closing window with a mouse or Alt-F3 }
  55.   WhereVGAFontEditor^.Flags := WhereVGAFontEditor^.Flags and not wfClose;
  56.   { Recreate VGA Font Editor's window frame without a close button }
  57.   WhereVGAFontEditor^.Frame^.DrawView;
  58.   { Pre Operation Message }
  59.   MessageBox(^M^C'VGA Font Editor'^M^C'(C) 1993 by Alex Levitas',
  60.          NIL, mfInformation + mfOKbutton);
  61.   { Run main program - actually, only the Font Editor }
  62.   A.Run;
  63.  end;
  64.  { End Main program }
  65.  A.Done;
  66. end.
  67.  
  68.  
  69. B. The Print Manager module has also several modules that enables defining the
  70. nature of its behavior at run time. Here they are:
  71.  
  72. - A group of PString pointers that points to strings including printer commands
  73.  
  74.  Double_Strike       { Start double-strike mode }
  75.  No_Double_Strike  { End double-strike mode }
  76.  Small           { Start compressed double-strike mode }
  77.  No_Small       { End compressed double-strike mode }
  78.  _Underlined       { Start underlined mode }
  79.  No_Underlined       { End underlined mode }
  80.  _Emphasized       { Start emphasized mode }
  81.  No_Emphasized       { End emphasized mode }
  82.  PageOut       { Page Out (Form Feed) }
  83.  
  84. The default of these pointers are commands in the ESC/P standard, which is
  85. suitable to EPSON of IBM-PROPRINTER compatible dot-matrix printers. If you
  86. want to use a different kind of a printer, it is simply required to pass
  87. these pointers addresses of strings containing the necessary printer commands.
  88.  
  89. - Variable WordValidChars.
  90.  WordValidChars: Set of char = ['0'..'9','A'..'Z','a'..'z','_'];
  91.  
  92. This variable defines which characters can compose a single word. For
  93. example, to treat also hebrew words, you should do this:
  94.  
  95.   WordValidChars := WordValidChars + ['Ç'..'Ü'];
  96.  
  97. - Variables AnyChar and AnyChars
  98.  
  99.  AnyChar: Char    =  '?';
  100.  AnyChars: Char =  '*';
  101.  
  102. These variables define which character will be the wildcards to define a single
  103. character or none (AnyChar variable), and to define a characters combination
  104. (AnyChars variable). For example, in a VAX/VMS, the '?' is replaced by the
  105. character '%'. To replace '?' with '%' do:
  106.  
  107.   AnyChar := '%';
  108.  
  109. - Variable CharRequired
  110.  
  111.  CharRequired: Boolean = FALSE;
  112.  
  113. This variable defines if the character '?' (or a replacing character defined
  114. by AnyChar) actually requires any character, or it can equal also to nothing.
  115. True means that a character must be available.
  116.  
  117. C. The MyGadget module contains several procedures and a Free Memory Viewer
  118. object.
  119.  
  120. The procedures are:
  121.  
  122. GoToLineNumber - jump current editor to the given line
  123. SetKbdSpeed - defines keyboard speed (in AT class an above computers)
  124. ExecuteDosCommand - execute a DOS command
  125. CloseAll - close all DeskTop windows
  126. SaveAll - save all text editor windows
  127.  
  128. All these procedures are without parameters. The first three open a dialog
  129. box to input required parameters.
  130. The objects of the Free Memory Viewer (names THeapView) has a similar
  131. interface to THeapView of the GADGETS module in EXAMPLES\TVDEMO in
  132. TURBO PASCAL 7.0. An example for this interface can be seen in the
  133. TVDEMO program from the same source. The only difference is that this new
  134. object show thae amount of free memory in percents instead of bytes.
  135.  
  136. 2. Manual for the end-user
  137.  
  138. Modules have acompanying text files that contain user guides. A file with an
  139. .SRC extension is written in a source format for the Turbo Vision Help Compiler
  140. version 1.1, and is intended to create context help for users in Turbo Vision
  141. programs. If you use context help in your program, then to use this file, you
  142. only have to enter this DOS command:
  143.  
  144.   COPY /B YOURHELP.EXT + MYHELP.SRC  ALL_HELP.TXT
  145.  
  146. where YOURHELP.TXT is the name of your help file, and ALL_HELP.TXT is the name
  147. of the final help file. You must recompile the help file with TVHC (Turbo
  148. Vision Help Compiler). A file with a .TXT extension is a normal text file ,that
  149. can be added to the user guide.
  150.  
  151.